<?php 
/*
 module:		会员充值订单
 create_time:	2022-04-07 20:15:44
 author:		
 contact:		
*/

namespace app\backend\service;
use app\backend\model\ZhVipOrder;
use think\exception\ValidateException;
use xhadmin\CommonService;

class ZhVipOrderService extends CommonService {


	/*
 	* @Description  列表数据
 	*/
	public static function indexList($where,$field,$order,$limit,$page){
		try{
//			$res = ZhVipOrder::where($where)->field($field)->order($order)->paginate(['list_rows'=>$limit,'page'=>$page])->toArray();
            $res = ZhVipOrder::alias('a')
                              ->join('member b','a.u_id=b.uid')
                              ->leftjoin('zh_matchmaker c','c.u_id = b.uid')
                              ->where($where)
                              ->field($field)
                              ->order($order)
                              ->paginate(['list_rows'=>$limit,'page'=>$page])
                              ->toArray();
		}catch(\Exception $e){
			abort(config('my.error_log_code'),$e->getMessage());
		}
		return ['rows'=>$res['data'],'total'=>$res['total']];
	}




}

